#include "DesignEntityTable.h"

DesignEntityTable::DesignEntityTable(){
	this->AssignDEIndex = vector<Node*>();
	this->ConstantDEIndex = vector<Node*>();
	this->IfDEIndex = vector<Node*>();
	this->WhileDEIndex = vector<Node*>();
}

bool DesignEntityTable::addAssignDe(Node* assignDE){
	if (assignDE->getDesignEntity()->getType() == ASSIGN){
		this->AssignDEIndex.push_back(assignDE);
		return true;
	}else{
		return false;
	}
}


bool DesignEntityTable::addConstantDe(Node* constantDE){
	if (constantDE->getDesignEntity()->getType() == CONSTANT){
		this->ConstantDEIndex.push_back(constantDE);
		return true;
	}else{
		return false;
	}
}

bool DesignEntityTable::addIfDe(Node* ifDE){
	if (ifDE->getDesignEntity()->getType() == IF){
		this->IfDEIndex.push_back(ifDE);
		return true;
	}else{
		return false;
	}
}

bool DesignEntityTable::addWhileDe(Node* whileDE){
	if (whileDE->getDesignEntity()->getType() == WHILE){
		this->WhileDEIndex.push_back(whileDE);
		return true;
	}else{
		return false;
	}
}

vector<Node*> DesignEntityTable::getAssignDe(){
	return this->AssignDEIndex;
}

vector<Node*> DesignEntityTable::getConstantDe(){
	return this->ConstantDEIndex;
}

vector<Node*> DesignEntityTable::getIfDe(){
	return this->IfDEIndex;
}

vector<Node*> DesignEntityTable::getWhileDe(){
	return this->WhileDEIndex;
}

void DesignEntityTable::clearAll(){
	this->AssignDEIndex.clear();
	this->ConstantDEIndex.clear();
	this->IfDEIndex.clear();
	this->WhileDEIndex.clear();
}